package com.hsylient.javase.chapter05;

import lombok.SneakyThrows;
import org.junit.Test;

import java.io.FileReader;

/**
 * 文件字符输入流在读取，纯普通文本文本的时候比较方便快捷
 */
public class E_MyFileReader {

    @Test
    @SneakyThrows
    public void testReader() {
        FileReader fileReader = new FileReader("D:\\IdeaProjects\\logger\\log\\JULCustomProperties.txt");
        char[] fileReaderCatch = new char[10];
        int readLen;
        while ((readLen = fileReader.read(fileReaderCatch)) != -1) {
            System.out.print(new String(fileReaderCatch, 0, readLen));
        }
    }
}
